# coding = utf-8
from building.api.stats_views import ProjectMonthStatsAPIView, DepositMonthStatsAPIView, BidBusinessStatsAPIView, \
    ProjectYearStatsAPIView
from django.urls import path
from rest_framework.routers import DefaultRouter
from building.api.views import ProjectViewSet, BidTypeViewSet, CategoryViewSet, DocumentUploadAPIView, ArchiveViewSet, \
    DocTypeViewSet, DepositViewSet, BidBusinessViewSet, ProjectListAPIView, ProjectFinanceViewSet, FundsDetailViewSet, \
    DocumentListAPIView, DocumentViewSet, BidDocumentViewSet, BidDocumentUploadAPIView, BidInspectorViewSet, \
    ProjectSearchAPIView

router = DefaultRouter()
router.register(r'project', ProjectViewSet, basename="project")
router.register(r'bid_type', BidTypeViewSet, basename="bid-type")
router.register(r'category', CategoryViewSet, basename="category")
router.register(r'archive', ArchiveViewSet, basename="archive")
router.register(r'document', DocumentViewSet, basename="document")
router.register(r'doc_type', DocTypeViewSet, basename="doc-type")
router.register(r'deposit', DepositViewSet, basename="deposit")
router.register(r'business', BidBusinessViewSet, basename="bid-business")
router.register(r'inspector', BidInspectorViewSet, basename="bid-inspector")
router.register(r'bid_document', BidDocumentViewSet, basename="bid-document")
router.register(r'finance', ProjectFinanceViewSet, basename="project-finance")
router.register(r'funds_detail', FundsDetailViewSet, basename="funds-detail")


urlpatterns = [
    path('project_list/', ProjectListAPIView.as_view(), name="api-project-list"),
    path('document_list/', DocumentListAPIView.as_view(), name="api-document-list"),
    path('file_upload/', DocumentUploadAPIView.as_view(), name="api-archive-document-upload"),
    path('bid_file_upload/', BidDocumentUploadAPIView.as_view(), name="api-bid-document-upload"),
    path('project_stats/', ProjectMonthStatsAPIView.as_view(), name="api-project-stats"),
    path('project_year_stats/', ProjectYearStatsAPIView.as_view(), name="api-project-year-stats"),
    path('deposit_stats/', DepositMonthStatsAPIView.as_view(), name="api-deposit-stats"),
    path('bid_stats/', BidBusinessStatsAPIView.as_view(), name="api-bid-business-stats"),
    path('project_search/', ProjectSearchAPIView.as_view(), name="api-project-search"),
]
urlpatterns += router.urls
